﻿CREATE TABLE [dbo].[Proveedores] (
    [IdProveedor]         INT             IDENTITY (1, 1) NOT NULL,
    [IdRubroProveedor]    INT             NOT NULL,
    [IdTipoIva]           TINYINT         NOT NULL,
    [IdListaPrecioCompra] INT             NOT NULL,
    [Codigo]              VARCHAR (20)    NOT NULL,
    [Nombre]              VARCHAR (50)    NOT NULL,
    [LimiteDeuda]         DECIMAL (19, 4) NOT NULL,
    [Cuit]                CHAR (11)       NOT NULL,
    [Email]               VARCHAR (50)    NOT NULL,
    [SitioWeb]            VARCHAR (100)   NOT NULL,
    [Observaciones]       VARCHAR (500)   NOT NULL,
    [Imagen]              IMAGE           NULL,
    [EstaEliminado]       BIT             CONSTRAINT [DF_Proveedores_EstaEliminado] DEFAULT ((0)) NOT NULL,
    CONSTRAINT [PK_Proveedores] PRIMARY KEY CLUSTERED ([IdProveedor] ASC),
    CONSTRAINT [FK_Proveedores_ListasPreciosCompras] FOREIGN KEY ([IdListaPrecioCompra]) REFERENCES [dbo].[ListasPreciosCompras] ([IdListaPrecioCompra]),
    CONSTRAINT [FK_Proveedores_RubrosProveedores] FOREIGN KEY ([IdRubroProveedor]) REFERENCES [dbo].[RubrosProveedores] ([IdRubroProveedor]),
    CONSTRAINT [FK_Proveedores_TiposIvas] FOREIGN KEY ([IdTipoIva]) REFERENCES [dbo].[TiposIvas] ([IdTipoIva])
);



